import Layout from '@/layout'

export const constantRoutes = [
  {
    path: '/login',
    component: () => import('@/views/login'),
    hidden: true
  },

  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },

  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard'),
      meta: { title: '首页', icon: 'dashboard' }
    }]
  }
]

// 动态路由
export const asyncRoutes = [
  // 权限管理
  {
    path: "/acl",
    name: "Acl",
    component: Layout,
    meta: {
      title: "权限管理",
      icon:'el-icon-lock'
    },
    children: [
      {
        name: "User",
        path: "user",
        component: () => import("@/views/acl/user/index.vue"),
        meta: {
          title: "用户管理",
        },
      },

      {
        name: "Role",
        path: "role",
        component: () => import("@/views/acl/role/index.vue"),
        meta: {
          title: "角色管理",
        }
      },

      {
        name: "RoleAuth",
        path: "/acl/role/auth",
        component: () => import("@/views/acl/role/component/auth/index.vue"),
      },

      {
        name: "Permission",
        path: "permission",
        component: () => import("@/views/acl/permission/index.vue"),
        meta: {
          title: "菜单管理",
        },
      },
    ],
  },
    // 商品管理
  {
  path: "/product",
  name: 'Product',
  component: Layout,
  meta:{
    title:'商品管理',
    icon:'el-icon-shopping-bag-1'
  },
  children: [
    {
      path: "trademark",
      name: "Trademark",
      component: () => import("@/views/product/trademark/index.vue"),
      meta: {
        title: "品牌管理",
      },
    },
    {
      path: "attr",
      name: "Attr",
      component: () => import("@/views/product/attr/index.vue"),
      meta: {
        title: "平台属性管理",
      },
    },
    {
      path: "spu",
      name: "Spu",
      component: () => import("@/views/product/spu/index.vue"),
      meta: {
        title: "spu管理",
      },
    },
    {
      path: "sku",
      name: "Sku",
      component: () => import("@/views/product/sku/index.vue"),
      meta: {
        title: "sku管理",
      },
    }
  ],
  }
]

// 任意路由
export const anyRoutes = [
 // 任意路由
 { path: '*', redirect: '/404', hidden: true }
]

